import { PageContainer } from '@ant-design/pro-components';
import { useModel } from '@umijs/max';
import { Button } from 'antd';

const AccessPage: React.FC = () => {
  const { count, add, minus } = useModel('counter');
  const { initialState } = useModel('@@initialState');
  console.log(initialState);

  return (
    <PageContainer
      ghost
      header={{
        title: '数据流',
      }}
    >
      <Button>-</Button>
      <span>{count}</span>
      <Button onClick={add}>+</Button>
      <p>{initialState?.name}</p>
      <p>{initialState?.age}</p>
      <Button onClick={initialState?.ageAdd}>age++</Button>
    </PageContainer>
  );
};

export default AccessPage;
